<?php
namespace Admin\Controller;
use Think\Controller;
class UtilController extends Controller {
	public function createDir($path){
		if (!file_exists($path)){
			$this->createDir(dirname($path));
			mkdir($path, 0777);
		}
	}
	public function getId(){
		$year_code = array('A','B','C','D','E','F','G','H','I','J');
		return $year_code[intval(date('Y'))-2015].
		strtoupper(dechex(date('m'))).date('d').
		substr(time(),-5).substr(microtime(),2,5).sprintf('%d',rand(0,9));
	}
	public function code(){
		$Verify =     new \Think\Verify();
		$Verify->fontSize = 15;
		$Verify->length = 4;
		$Verify->useNoise = false;
		$Verify->entry();
	}
	public function check_verify($code) {
		$Verify =  new \Think\Verify();
		if(!$Verify->check($code)){
            return false;
        }
        else{
        	return true;
        }
        
 	}
}